﻿using CPPEI.Coolzon.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.Service
{
    /// <summary>
    /// 设计服务
    /// </summary>
    [ServiceContract]
    public interface IVersionService
    {
        /// <summary>
        /// 签出文件
        /// </summary>
        /// <param name="userIdentity"></param>
        /// <param name="fileName"></param>
        [OperationContract]
        ServiceResult Checkout(string userIdentity, string fileName);

        /// <summary>
        /// 签入文件
        /// </summary>
        /// <param name="userIdentity"></param>
        /// <param name="fileName"></param>
        /// <param name="data"></param>
        [OperationContract]
        ServiceResult Checkin(string userIdentity, string fileName, byte[] data);

        /// <summary>
        /// 获取最新版本的文件信息
        /// </summary>
        /// <param name="userIdentity"></param>
        /// <param name="fileName"></param>
        /// <param name="localChangeset">本地变更集</param>
        /// <returns></returns>
        [OperationContract]
        VersionFileEntity GetLatestVersion(string userIdentity, string fileName, double localChangeset);
    }
}
